package Polymorphic;
//20230404430920沈泽华
public class Main {
    public static void main(String[] args) {
        Animal al1 = new Dog();
        Animal al2 = new Cat();
        show(al1);
        show(al2);
    }
    public static void show(Animal al){
        al.cry();

        if(al instanceof Cat){
            Cat c = (Cat) al;
            c.catchMouse();
        } else if (al instanceof  Dog) {
            Dog d = (Dog) al;
            d.lookHome();
        }
    }

}